<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<style type="text/css">
	ul.page-sidebar-menu{
	min-height: 500px;
}
.wraping{
	background: #fff;
	
}
.table_btn_box{
		margin-bottom: 5px;
		float: left;
	}
		.modal-content .modal-footer button.btn-primary {
		margin-top:0; 
		margin-bottom: 0;
	}
		.btn-div{
		float: left;top: 10px;margin-bottom: 5px;padding-left: 10px;
	}
			.row{
			margin: 0;
		}
</style>
<body class="page-header-fixed">

			<div class="btn-div">

				<a class="btn blue" href="javascript:;" ng-click="syncOperMerchant();">
					<i class="fa fa-plus"></i>
						同步运营商
				</a>
			</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>通讯编号</th>
					<th>名称</th>
					<th>电话</th>
					<th>审核状态</th>
					<th>是否使用</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="operMerchant in allOperMechantList  track by $index" pg-loaded="{{$last}}" target-table="table_1">
					<td>
						<span ng-bind="operMerchant.communication_no"></span>
					</td>
					<td>
						<span ng-bind="operMerchant.oper_name | commonSubString"></span>
					</td>
					<td>
						<span ng-bind="operMerchant.tel"></span>
					</td>
					<td>
						<span ng-bind="operMerchant.review_state  | getValueInStaticFilter : 'reviewStateArray'"></span>
					</td>
					<td>
						<span ng-bind="operMerchant.valid_flag  | getValueInStaticFilter : 'validArray'"></span>
					</td>
					<td>
						<a class="btn" href="javascript:;"  data-target="#operMerchantModel" 
						data-toggle="modal" ng-click="updateOperMerchant(operMerchant);">
							修改
						</a>
						<a class="btn" href="javascript:;"  data-target="#operMerchantBranchList" 
						data-toggle="modal" ng-click="operMerchantBranchManage(operMerchant);">
							分公司管理
						</a>
					</td>
				</tr>
			</tbody>
			</table>
			<tm-pagination conf="paginationConf"></tm-pagination>
			<div id="operMerchantModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
				<div class="modal-dialog">
					<div class="modal-content">						
					<form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="validReset();">×</button>
							<h4 class="modal-title">充电运营商修改</h4>
						</div>

						<div class="modal-body form">
							<div class="form-group">
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>名称</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedOperMerchant.oper_name" name="oper_name" required="" placeholder="请输入字母、数字、中文和下划线组合" ng-pattern="/^[\u4e00-\u9fa5\w]*$/" ng-maxlength="60"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>电话</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedOperMerchant.tel" name="tel" ng-pattern="/^\d{7,11}$/" required="" />
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否厂商</label>
									<div class="col-md-8 paddingTop">
										<div class="radio-list">
											<label  class="radio-inline col-md-4">
												<input ng-model="selectedOperMerchant.isFactory" type="radio"  value="1" 
												ng-selected="selectedOperMerchant.isFactory==1">
													是
											</label>
											<label  class="radio-inline col-md-4">
												<input ng-model="selectedOperMerchant.isFactory" type="radio"  value="0" 
												ng-selected="selectedOperMerchant.isFactory==0"/>
													否
											</label>
										</div>
									</div>
								</div>
								<div class="row" ng-if="selectedOperMerchant.isFactory==1">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>所属厂商</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" 
											ng-options="factory.factory_id as factory.factory_name for factory in factoryList " 
											ng-model="selectedOperMerchant.factory_id" required="" name="factory_id">
											<option value="">请选择厂商</option>
											</select>
										</div>
									</div>
								</div>
<!-- 								<div class="row" ng-if="'insert'!=modifyType">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否启用</label>
									<div class="col-md-8">
										<div class="radio-list">
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedOperMerchant.valid_flag" type="radio"  value="1" 
												ng-selected="selectedOperMerchant.valid_flag==1">
													启用
											</label>
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedOperMerchant.valid_flag" type="radio"  value="0" 
												ng-selected="selectedOperMerchant.valid_flag==0">
													停用
											</label>
										</div>
									</div>
								</div> -->
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="validReset();"><i class="fa fa-times"></i>关闭</button>
							<button type="button" class="btn btn-primary" w5c-form-submit="modifyOperMerchant();"><i class="fa fa-check"></i>保存</button>
						</div>
						</form>
					</div>
				</div>
			</div>
			<div id="operMerchantBranchList" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false" >
				<div class="modal-dialog" style="width:1000px">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">×</button>
							<h4 class="modal-title">运营商【{{selectedOperMerchant.oper_name}}】分公司管理</h4>
						</div>

						<div class="modal-body form">

							<div class="form-group">
								<div class="table_btn_box">
									<a class="btn blue" href="javascript:;"  data-target="#operMerchantBranchModel" 
										data-toggle="modal" ng-click="addOperMerchantBranch();">
										<i class="fa fa-plus"></i>
											新增
									</a>
								</div>
								<table class="table table-striped table-bordered table-hover"
									id="table_2">
									<thead>
										<tr>
											<th>分公司名字</th>
											<th>分公司电话</th>
											<th>是否使用</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<tr class="odd gradeX"
											ng-repeat="operMerchantBranch in operMerchantOMBList  track by $index"
											on-loaded="{{$last}}" target-table="table_2">
											<td><span
												ng-bind="operMerchantBranch.oper_name | commonSubString"></span>
											</td>
											<td><span
												ng-bind="operMerchantBranch.tel"></span>
											</td>
											
											<td><span ng-bind="operMerchantBranch.valid_flag | getValueInStaticFilter : 'validArray'"></span>
											</td>
											<td>
												<a class="btn" href="javascript:;"  data-target="#operMerchantBranchModel" 
												data-toggle="modal" ng-click="updateOperMerchantBranch(operMerchantBranch);">
													修改
												</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal">
								<i class="fa fa-times"></i>关闭
							</button>
						</div>
					</div>
				</div>
			</div>

			<div id="operMerchantBranchModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
				<div class="modal-dialog">
					<div class="modal-content">						
					<form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm"> 
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="validateForm.reset()">×</button>
							<h4 class="modal-title">运营商分公司新增/修改</h4>
						</div>

						<div class="modal-body form">
							<div class="form-group">
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>名称</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedOMB.oper_name" name="oper_name" required="" ng-pattern="/^[\u4e00-\u9fa5\w]*$/" placeholder="请输入字母、数字、中文和下划线组合"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>电话</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedOMB.tel" name="tel" ng-pattern="/^\d{7,11}$/" required=""/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>城市代码</label>
									<div class="col-sm-8">
										<div class="input-group">
											<district-select
					                        area-list="areaList" 
					                        city-list="cityList"
					                        district-list="districtList"
					                        selected-area="selectedArea" 
					                        selected-city="selectedCity" 
					                        selected-district="selectedDistrict"
					                        has-init-value="hasInitValue" >
					                        </district-select>
										</div>
									</div>
								</div>

								
								<div class="row" ng-if="'insert'!=modifyType">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否启用</label>
									<div class="col-md-8">
										<div class="radio-list">
											<label  class="radio-inline col-md-4">
												<input ng-model="selectedOMB.valid_flag" type="radio"  value="1" 
												ng-selected="selectedOMB.valid_flag==1">
													启用
											</label>
											<label  class="radio-inline col-md-4">
												<input ng-model="selectedOMB.valid_flag" type="radio"  value="0" 
												ng-selected="selectedOMB.valid_flag==0">
													停用
											</label>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="validateForm.reset()"><i class="fa fa-times"></i>关闭</button>
							<button type="button" class="btn btn-primary" w5c-form-submit="modifyOperMerchantBranch();"><i class="fa fa-check"></i>保存</button>
						</div>
						</form>
					</div>
				</div>
			</div>

</body>
</html>
